home *** CD-ROM | disk | FTP | other *** search
/ hornet.scene.org / hornet.scene.org FTP 11-25-2012.zip / hornet.scene.org FTP 11-25-2012 / code / library / i3ddemo2.exe / VGA_DRAW.H < prev   
C/C++ Source or Header  |  1994-02-10  |  5KB  |  130 lines

  1. //***************************************************************************
  2. //*                                                                         *
  3. //* Interactive 3D Tool Kit I3D v2.0                                        *
  4. //*                                                                         *
  5. //* Functions for drawing in VGA mode 0x13 (320x200x256)                    *
  6. //*                                                                         *
  7. //* (c) 1993-94 Jim O'Keane                                                 *
  8. //* All Rights Reserved Worldwide                                           *
  9. //*                                                                         *
  10. //***************************************************************************
  11.  
  12. #ifndef _VGA_DRAW_H
  13.  
  14. #define _VGA_DRAW_H 1
  15.  
  16. #if defined ( __cplusplus )
  17.   extern "C" {
  18. #endif
  19.  
  20. // Bios Mode 0x13 VGA
  21. #define SCREEN_WIDTH  320
  22. #define SCREEN_HEIGHT 200
  23.  
  24. // which fields in DACPAL256 correspond to which color components
  25. #define RED   0
  26. #define GREEN 1
  27. #define BLUE  2
  28.  
  29. ///////////////////////////////////////////////////////////////////////////
  30. // NOTE: None of these routines can take XMS handles as arguments! ////////
  31. ///////////////////////////////////////////////////////////////////////////
  32.  
  33. // set clipping rectangle
  34. void FAR PASCAL set_clip_rect(short min_x, short min_y,
  35.                               short max_x, short max_y);
  36.  
  37. // Set the off-screen buffer to buf
  38. BYTE *  FAR PASCAL set_screen_buf(BYTE FAR *buf);
  39.  
  40. // Set the off-screen buffer dimensions
  41. short   FAR PASCAL set_screen_buf_size(short width,short height);
  42.  
  43. // Put a pixel into the off-screen buffer at (x,y) in color
  44. void    FAR PASCAL put_pix(short x, short y, short color);
  45.  
  46. void    FAR PASCAL nc_put_pix(short x, short y, short color);
  47.  
  48. // Return color of pixel at (x,y)
  49. short   FAR PASCAL get_pix(short x, short y);
  50.  
  51. short   FAR PASCAL nc_get_pix(short x, short y);
  52.  
  53. // Clear off-screen buffer to color
  54. void    FAR PASCAL clear_screen_buf(short color);
  55.  
  56. // Clear lines in off-screen buffer from start to end to color
  57. void    FAR PASCAL clear_screen_lines(short color,short start,short end);
  58.  
  59. // Draw a solid colored rect in off-screen color
  60. void    FAR PASCAL draw_rect(short ulx, short uly, short width, short height,
  61.                              short color);
  62.  
  63. void    FAR PASCAL nc_draw_rect(short ulx, short uly, short width, short height,
  64.                                 short color);
  65.  
  66. // Draw a line in off-screen buffer in color
  67. void    FAR PASCAL draw_line(short x1, short y1, short x2, short y2, short color);
  68.  
  69. void    FAR PASCAL nc_draw_line(short x1, short y1, short x2, short y2, short color);
  70.  
  71. // Draw a circle in off-screen buffer with edge and fill
  72. // if edge = -1 then no edge drawn, if fill = -1 then no fill drawn
  73. void FAR PASCAL draw_circle(short xc, short yc, short r, short edge, short fill);
  74.  
  75. // Draw a concave or convex polygon in off-screen buffer with edge and fill
  76. // if edge = -1 then no edge drawn, if fill = -1 then no fill drawn
  77. BOOL FAR PASCAL draw_polygon(short nvert, POINT FAR *point, short edge, short fill);
  78.  
  79. // Put image in buf to off-screen buffer at x,y
  80. void    FAR PASCAL put_image(BYTE FAR *buf, short x, short y, short w, short h);
  81.  
  82. void    FAR PASCAL nc_put_image(BYTE FAR *buf, short x, short y, short w, short h);
  83.  
  84. // Get image into buf from off-screen buffer at x,y
  85. void    FAR PASCAL get_image(BYTE FAR *buf, short x, short y, short w, short h);
  86.  
  87. // Put image in buf to off-screen buffer at x,y with color 0 transparent
  88. void    FAR PASCAL put_trans_image(BYTE *buf, short x, short y, short w, short h);
  89.  
  90. void    FAR PASCAL nc_put_trans_image(BYTE *buf, short x, short y, short w, short h);
  91.  
  92. // Copy off-screen buffer to VGA memory REAL fast!
  93. void    FAR PASCAL update_screen(void);
  94.  
  95. // Copy a portion of off-screen buffer to VGA memory fast!
  96. void    FAR PASCAL update_rect(short ulx, short uly, short width, short height);
  97.  
  98. // Fire up VGA mode 0x13 320x200 256 colors
  99. void    FAR PASCAL init_graphics(void);
  100.  
  101. // Return to previous video mode, free memory
  102. void    FAR PASCAL exit_graphics(void);
  103.  
  104. // Get the VGA palette
  105. void    FAR PASCAL get_vga_palette_256(DACPAL256 FAR *PalBuf);
  106.  
  107. // Set the VGA palette
  108. void    FAR PASCAL set_vga_palette_256(DACPAL256 FAR *PalBuf);
  109.  
  110. // Set the current text font parameters
  111. void    FAR PASCAL text_font(short width, short height, short space, BYTE FAR *font_ptr);
  112.  
  113. // Set the current text colors
  114. void    FAR PASCAL text_color(short forecolor, short backcolor, short transparent);
  115.  
  116. // Draw some text in the off-screen buffer
  117. void    FAR PASCAL text_xy(short x, short y, char FAR *text);
  118.  
  119. // Fade palette in from black
  120. void    FAR PASCAL vga_palette_fadein(DACPAL256 FAR *pal);
  121.  
  122. // Fade palette out to black
  123. void    FAR PASCAL vga_palette_fadeout(DACPAL256 FAR *pal);
  124.  
  125. #if defined ( __cplusplus )
  126.   }
  127. #endif
  128.  
  129. #endif 
  130.